package com.jiyun.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiyun.mapper.RoleMapper;
import com.jiyun.model.xitong.Biaoqian;
import com.jiyun.model.xitong.Permissions;
import com.jiyun.model.xitong.Role;

import com.jiyun.service.IRoleService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2024-09-23
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {
        @Autowired
        private RoleMapper roleMapper;



        @Override
        public List<Role> findAll() {
                return  roleMapper.selectList(null);
        }

        @Override
        public Integer add(Role role) {
                Role role1 = new Role();
                role1.setName(role.getName());
                role1.setMs(role.getMs());
                role1.setCreatetime(new Date());
                return  roleMapper.insert(role1);
        }

        @Override
        public Integer updates(Role role) {
                return roleMapper.updateById(role);
        }

        @Override
        public Integer del(Integer id) {
                return roleMapper.deleteById(id);
        }


}
